package com.guodi.model.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guodi.model.entity.UeProjectManger;
import com.guodi.model.entity.UeUpdateRecords;
import com.guodi.model.mapper.UeUpdateRecordsMapper;
import com.guodi.model.service.IUeUpdateRecordsService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * @描述：项目管理-更新记录表 服务类
 * @作者: 徐金洲
 * @日期: 2023-05-06
 */
@Service
public class UeUpdateRecordsServiceImpl extends ServiceImpl<UeUpdateRecordsMapper, UeUpdateRecords> implements IUeUpdateRecordsService {

    @Resource
    private UeUpdateRecordsMapper ueUpdateRecordsMapper;

    @Override
    public List<UeUpdateRecords> getUpdateRecordsList(String ProjectId) {
        LambdaQueryWrapper<UeUpdateRecords> queryWrapper = (new QueryWrapper()).lambda();
        queryWrapper.eq(UeUpdateRecords::getProjectId,ProjectId);
        queryWrapper.orderByAsc(UeUpdateRecords::getUpdateTime);
        List<UeUpdateRecords> list = ueUpdateRecordsMapper.selectList(queryWrapper);
        return list;
    }

    @Override
    public boolean deleteByProjectId(String ProjectId) {
        return ueUpdateRecordsMapper.deleteByProjectId(ProjectId);
    }
}
